package cn.quuan.RandomInfo.Controller;


public class TestRand {
    public static void main(String[] args) {
        Person person = new Person();
        RandInfo randInfo = new RandInfo();
        for (int i = 0; i < 100; i++) {

            // 姓氏随机生成
            String familyName = randInfo.randFamilyName();
            // 名字依托于性别产生
            String randName = randInfo.randName(randInfo.randSex());
            String[] fixed = randName.split("-");
            String name = fixed[0];
            String sex = fixed[1];
            int age = randInfo.randAge();
            String birthday = randInfo.randBirthday(age);

            //将随机生成的 yyyy-MM-dd 格式的生日 转为 yyyyMMdd 格式，便于身份号的随机
            String IdBirthday = birthday.toString().replaceAll("-", "");

            String IdNum=randInfo.getRandomID(IdBirthday);
            person.setName(familyName.concat(name));
            person.setSex(sex);
            person.setAge(age);
            person.setBirthday(birthday);
            person.setIdNumber(IdNum);
            person.setTel(randInfo.getTel());
            person.setEmail(randInfo.getEmail(6,9));


            System.out.println(person);
        }
    }
}
